Repository navigation
build(server): update QueryKit to 1.17.1 and let a filter value start or end with a quote - #394
Conversation
… or end with a quote QueryKit 1.17.1 removes one space from each end of a raw string when the text starts and ends with a space and is not all spaces. The filter builder now pads each raw string with one space, so a quote at the start or the end of a value stays part of the value. The text and multiselect controls no longer refuse such a value, and the badge no longer marks a preset with one as not used.
Independent verification of 173921f: PASS+NOTESGoal: a user of the filter builder can filter on any text, including text that starts or ends with a I ran the stack isolated from a fresh worktree at Filter demo (
|
| filters | status | titles returned |
|---|---|---|
title == """ "Paul" """ |
200 | "Paul" |
title == "Paul" |
200 | Paul |
title == """ quote" """ |
200 | quote" |
title == """ Say "hi" now """ |
200 | Say "hi" now |
title @=* """ "Paul" """ (demo output, key swapped) |
200 | "Paul" |
title @=* """ quote" """ (demo output, key swapped) |
200 | quote" |
title @=* """ Say "hi" now """ (demo output, key swapped) |
200 | Say "hi" now |
title @=* "Paul" |
200 | "Paul", Paul |
title ^^ [""" "Paul" """, """ quote" """] |
200 | "Paul", quote" |
title ^^ ["Paul"] |
200 | Paul |
Each padded filter returns only its own row. The recipe run passed with no page errors. The only console or network error was the documented 404 of GET /api/v1/users/by-identifier/{sub} for a new user. The data restore passed.
Notes
- The demo has no multiselect option with a quote at an end, so I could not drive that case in the UI. The server side of the case passes: the padded in-list form (
^^ [""" "Paul" """, ...]) returns the right rows. - Harness gap, not caused by this PR:
settle()does not wait for the Motion draw-in of the checkbox checkmark. So acapture()right after a checkbox click shows a filled box with no checkmark. A probe showed that the path ends atopacity: 1with no dash array, and that the checkmark then draws correctly. - The known gap A quoted list item loses the spaces at its ends QueryKit#216 (edge spaces of a quoted list item) was not tested, because no template option has such a value.
Evidence (local): /Users/paul/repos/FullstackTemplate-worktrees/verify-394-evidence/ holds pr394-2/ (screenshots 01-dialog-quote-value.png, 02-three-quote-filters.png, 03-edit-quote-badge.png, 04-grouping-selection.png, 05-grouped.png, 06-grouped-or.png, trace.zip, steps.log), cbprobe-2/01-probe.png, the sweep runs, and the recipe recipes/pr394.mjs.
Why
A user of the filter builder must be able to filter on any text, including text that starts or ends with a
". QueryKit 1.17.0 could not hold such a value, so #372 made the filter builder refuse it. QueryKit 1.17.1 (pdevito3/QueryKit#214) removes one space from each end of a raw string when the text starts and ends with a space and is not all spaces. A padded raw string now holds every value.What changed
quoteTextpads each raw literal with one space:""" "Paul" """. A value with no quote keeps the"..."form.querykit-text.ts, the messages in the text and multiselect controls, the "This filter is not used" badge, and the layout changes that only that badge needed.filter-badge.tsx,filter-builder.tsx, andfilter-group.tsxare back to their form before fix(frontend): quote each text value of a QueryKit filter, and refuse a value with a quote at an end #372.frontend-featureskill gives the padded form and the delimiter rule.Tests
WorkshopListQueryTestsproves on Postgres that each padded literal finds only its own row. For example,title == """ "Paul" """finds"Paul"and notPaul.text-filter.spec.tschecks the QueryKit text in the filter demo.Local runs:
pnpm lint,pnpm build,pnpm test(513 tests), the filter demo e2e specs (230 passed),WorkshopListQueryTests(24), andQueryKitInputExtensionsTests(41).Known gap
QueryKit removes all edge spaces from a quoted list item (pdevito3/QueryKit#216). So a multiselect option with a space at an end matches the trimmed text. No option in the template has such a value. This gap existed before this PR.